<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>交易记录管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/payment/transactionRecord/">交易记录列表</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="transactionRecord" action="${ctx}/payment/transactionRecord/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<%-- <ul class="ul-form">
			<li><label>标题：</label>
				<form:input path="title" htmlEscape="false" maxlength="100" class="input-medium"/>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul> --%>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>类型</th>
				<th>出账人</th>
				<th>金额</th>
				<th>状态</th>
				<th>来源</th>
				<th>创建日期</th>
				<shiro:hasPermission name="payment:transactionRecord:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="transactionRecord">
			<tr>
				<td>
					${fns:getDictLabel(transactionRecord.type, 'transaction_type', '')}
				</td>
				<td>
					${(fns:getUserById(transactionRecord.srcUserId)).nickname}
				</td>
				<td>
					<fmt:formatNumber value="${transactionRecord.fee }" pattern="0.00"/>
				</td>
				<td>
					${transactionRecord.statusDes }
				</td>
				<td>
					${fns:getDictLabel(transactionRecord.source, 'transaction_record_source', '')}
				</td>
				<td>
					<fmt:formatDate value="${transactionRecord.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<shiro:hasPermission name="payment:transactionRecord:edit"><td>
					<c:choose>
						<c:when test="${transactionRecord.status == 1 && transactionRecord.type == 6 }">
							<a href="${ctx}/payment/transactionRecord/form?id=${transactionRecord.id}&flag=edit">处理</a>
						</c:when>
						<c:otherwise>
							<a href="${ctx}/payment/transactionRecord/form?id=${transactionRecord.id}&flag=info">详情</a>
						</c:otherwise>
					</c:choose>					
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>